Type-only imports and exports
typeのみのimport/exportができる
code:ts
import type { SomeThing } from "./some-module.js";
code:ts
export type { SomeThing };
code:before.ts
import { Foo1 } from "foo";
import type { Foo2 } from "foo";
code:after.ts
import { Foo1, type Foo2 } from "foo";
通常は特に気にする必要はないっぽい
型も普通にimoprtで書けばいい
特定のtranspilerを使った時にimportで書くと無理になるケースがあり、その時にimport typeが役立つらしい
いつ問題が起こるのか?
Webpackを使った時に起こるらしい